import type { RouteRecordRaw } from 'vue-router';

import { BasicLayout } from '#/layouts';

const routes: RouteRecordRaw[] = [
  {
    component: BasicLayout,
    meta: {
      icon: 'ic:baseline-view-in-ar',
      keepAlive: true,
      order: 1000,
      title: '公共资源',
    },
    name: 'Books',
    path: '/books',
    children: [
      {
        meta: {
          title: '书籍',
        },
        name: 'books',
        path: '/resources/books',
        component: () => import('#/views/resources/books/index.vue'),
      },
      {
        meta: {
          hidden: false,
          hideInMenu: true,
          title: '书籍详情',
        },
        name: 'view-books',
        path: '/resources/books/book-view',
        component: () => import('#/views/resources/books/book-view.vue'),
        props: (route) => ({
          bookId: route.query.bookId,
          title: route.query.title,
        }),
      },
    ],
  },
];

export default routes;
